package com.onlinevideo.service.impl;

import com.onlinevideo.dao.FavoritesDao;
import com.onlinevideo.dao.FavoritesVideoDao;
import com.onlinevideo.dao.impl.FavoritesDaoImpl;
import com.onlinevideo.dao.impl.FavoritesVideoDaoImpl;
import com.onlinevideo.entity.FavoritesVideo;
import com.onlinevideo.service.FavoritesVideoService;

import java.util.List;

public class FavoritesVideoServiceImpl implements FavoritesVideoService {

    private FavoritesVideoDao favoritesVideoDao = new FavoritesVideoDaoImpl();
    private FavoritesDao favoritesDao = new FavoritesDaoImpl();

    @Override
    public int insert(FavoritesVideo favoritesVideo) {
        return favoritesVideoDao.insert(favoritesVideo);
    }

    @Override
    public int delete(Long id) {
        return favoritesVideoDao.delete(id);
    }

    @Override
    public int deleteByVideoId(Long videoId) {
        return favoritesVideoDao.deleteByVideoId(videoId);
    }

    @Override
    public int update(FavoritesVideo favoritesVideo) {
        return favoritesVideoDao.update(favoritesVideo);
    }

    @Override
    public FavoritesVideo queryById(Long id) {
        return favoritesVideoDao.queryById(id);
    }

    @Override
    public List<FavoritesVideo> queryAll() {
        return favoritesVideoDao.queryAll();
    }

    @Override
    public List<FavoritesVideo> queryByFavorites(Long favoritesId) {
        return favoritesVideoDao.queryByFavorites(favoritesId);
    }

    @Override
    public List<FavoritesVideo> queryByFavorAndVideo(Long favoritesId, Long videoId) {
        return favoritesVideoDao.queryByFavorAndVideo(favoritesId, videoId);
    }
}
